
import socket
import re

sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.connect(('localhost', 8173))

sock.send('simple\n')

while True:
	s = sock.recv(4096)
	if not s:
		return
	m = re.match(r'^(.*):\s*(\d+)$', s)
	file = m.group(1)
	line = m.group(2)
	print file + ': ' + line
	op = raw_input('>')
	sock.send(op+'\n')

s.close()

